import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import(/* webpackChunkName: "about" */ '../views/web/Home.vue'),
    redirect:'/index',
    children:[
      {
        path: '/guanyu',
        name: 'guanyu',
        component:()=> import('../components/guanyu'),
      },
      {
        path: '/teacherOne',
        name: 'teacherOne',
        component:()=> import('../components/teacherOne'),
      },
      {
        path: '/k1',
        name: 'k1',
        component:()=> import('../views/web/kecheng/kechengzhongxin'),
      },
      {
        path: '/index',
        name: 'index',
        component: () => import(/* webpackChunkName: "about" */ '../components/index')
      },

      {
        path: '/courseDetails',
        name: 'courseDetails',
        component:()=> import('../components/courseDetails'),
      },
      {
        path: '/user',
        name: 'userindex',
        component:()=>import('../views/web/user/userindex'),
        children:[
          {
            path: '/information',
            name: 'information',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/userdata/information')
          },
          {
            path: '/password',
            name: 'password',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/userdata/password')
          },
          {
            path: '/study',
            name: 'study',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/userdata/study')
          },
          {
            path: '/order',
            name: 'order',

            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/userdata/order')
          },
          {
            path: '/lbgl',
            name: 'lbgl',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/lubo/lbgl')
          },
          {
            path: '/add',
            name: 'add',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/lubo/add')
          },
          {
            path: '/chapter',
            name: 'chapter',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/lubo/chapter')
          },
          {
            path: '/eduVideo',
            name: 'eduVideo',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/lubo/eduVideo')
          },
          {
            path: '/course',
            name: 'course',

            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/userdata/course')
          },
          {
            path: '/collection',
            name: 'collection',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/userdata/collection')
          },
          {
            path: '/follow',
            name: 'follow',
            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/userdata/follow')
          },
          {
            path: '/teacherCenter',
            name: 'teacherCenter',

            component: () => import(/* webpackChunkName: "about" */ '../views/web/user/lubo/teacherCenter')
          },

        ]
      },
      {
        path: '/result/re-teacher',
        name: 'Re-teacher',
        component:()=> import('../views/web/re-teacher/re-teacher'),
        children: [
          {
            path: '/result/re-toApply',
            name: 'Re-toApply',
            component:()=> import('../views/web/re-teacher/result/re-toApply'),
          },
          {
            path: '/result/re-result',
            name: 'Re-result',
            component:()=> import('../views/web/re-teacher/result/re-result'),
          },
        ]
      },
    ]
  },



  {
    path: '/apply/re-apply',
    name: 'Re-apply',
    component:()=> import('../views/web/re-teacher/apply/re-apply'),
    children:[
      {
        path: '/apply/re-agreement',
        name: 'Re-agreement',
        component:()=> import('../views/web/re-teacher/apply/re-agreement'),
      },
      {
        path: '/apply/re-message',
        name: 'Re-message',
        component:()=> import('../views/web/re-teacher/apply/re-message'),
      },
      {
        path: '/apply/re-examine',
        name: 'Re-examine',
        component:()=> import('../views/web/re-teacher/apply/re-examine'),
      },

    ]
  },
  {
    path: '/login',
    name: 'login',
    component:()=>import('../views/web/login')
  },
  {
    path: '/wx',
    name: 'wx',
    component:()=>import('../components/wx')
  },
  {
    path: '/zfb',
    name: 'zfb',
    component:()=>import('../components/zfb')
  },
]

const router = new VueRouter({
  routes
})

export default router
